package br.mercadofacil.app.hma;

import com.google.ads.AdRequest;
import com.google.ads.AdView;

import android.app.Activity;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.os.Bundle;
import android.view.View;
import android.widget.CheckBox;
import android.widget.ImageButton;

public class Lista_Limpeza extends Activity {

	String AguaSanitaria = "";
	String Alcool = "";
	String Amaciante = "";
	String Antimofo = "";
	String CeraPasta = "";
	String CeraLiquida = "";
	String Desinfetante = "";
	String Detergente = "";
	String Inseticida = "";
	String LimpaAluminio = "";
	String LimpaVidro = "";
	String Multiuso = "";
	String Odorizador = "";
	String Removedor = "";
	String Repelente = "";
	String SabaoPedra = "";
	String SabaoPo = "";
	String LadeAco = "";
	String SabaoCoco = "";
	String Sapolio = "";

	CheckBox chbAguaSanitaria, chbAlcool, chbAmaciante, chbAntiMofo,
			chbCeraPasta, chbCeraLiquida, chbDesinfetante, chbDetergente,
			chbInseticida, chbLimpaAluminio, chbLimpaVidro, chbMultiuso,
			chbOdorizador, chbRemovedor, chbRepelente, chbSabaoPedra,
			chbSabaoPo, chbLadeAco, chbSabaoCoco, chbSapolio;

	public static final String PREFS_NAME = "SharedPrefsDemoPreferences";
	private SharedPreferences mPrefs;

	private CheckBox CheckBoxAguaSanitaria, CheckBoxAlcool, CheckBoxAmaciante,
			CheckBoxAntimofo, CheckBoxCeraPasta, CheckBoxCeraLiquida,
			CheckBoxDesinfetante, CheckBoxDetergente, CheckBoxInseticida,
			CheckBoxLimpaAluminio, CheckBoxLimpaVidro, CheckBoxMultiuso,
			CheckBoxOdorizador, CheckBoxRemoveodr, CheckBoxRepelente,
			CheckBoxSabaoPedra, CheckBoxSabaoPo, CheckBoxLadeAco,
			CheckBoxSabaoCoco, CheckBoxSapolio;

	public static final String PREF_BOOL61 = "PrefBool61";
	public static final String PREF_BOOL62 = "PrefBool62";
	public static final String PREF_BOOL63 = "PrefBool63";
	public static final String PREF_BOOL64 = "PrefBool64";
	public static final String PREF_BOOL65 = "PrefBool65";
	public static final String PREF_BOOL66 = "PrefBool66";
	public static final String PREF_BOOL67 = "PrefBool67";
	public static final String PREF_BOOL68 = "PrefBool68";
	public static final String PREF_BOOL69 = "PrefBool69";
	public static final String PREF_BOOL70 = "PrefBool70";
	public static final String PREF_BOOL71 = "PrefBool71";
	public static final String PREF_BOOL72 = "PrefBool72";
	public static final String PREF_BOOL73 = "PrefBool73";
	public static final String PREF_BOOL74 = "PrefBool74";
	public static final String PREF_BOOL75 = "PrefBool75";
	public static final String PREF_BOOL76 = "PrefBool76";
	public static final String PREF_BOOL77 = "PrefBool77";
	public static final String PREF_BOOL78 = "PrefBool78";
	public static final String PREF_BOOL79 = "PrefBool79";
	public static final String PREF_BOOL80 = "PrefBool80";

	ImageButton btnPagina5;

	public static Object LevaAguaSanitaria;
	public static Object LevaAlcool;
	public static Object LevaAmaciante;
	public static Object LevaAntimofo;
	public static Object LevaCeraPasta;
	public static Object LevaCeraLiquida;
	public static Object LevaDesinfetante;
	public static Object LevaDetergente;
	public static Object LevaInseticida;
	public static Object LevaLimpaAluminio;
	public static Object LevaLimpaVidro;
	public static Object LevaMultiuso;
	public static Object LevaOdorizador;
	public static Object LevaRemovedor;
	public static Object LevaRepelente;
	public static Object LevaSabaoPedra;
	public static Object LevaSabaoPo;
	public static Object LevaLadeAco;
	public static Object LevaSabaoCoco;
	public static Object LevaSapolio;

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.aba_limpeza);
		
		AdView adView3 = (AdView)this.findViewById(R.id.adView3);  
		adView3.loadAd(new AdRequest());

		mPrefs = getSharedPreferences(PREFS_NAME, 0);

		CheckBoxAguaSanitaria = (CheckBox) findViewById(R.id.checkBoxAguaSanitaria);
		chbAguaSanitaria = (CheckBox) findViewById(R.id.checkBoxAguaSanitaria);
		CheckBoxAlcool = (CheckBox) findViewById(R.id.checkBoxAlcool);
		chbAlcool = (CheckBox) findViewById(R.id.checkBoxAlcool);
		CheckBoxAmaciante = (CheckBox) findViewById(R.id.checkBoxAmaciante);
		chbAmaciante = (CheckBox) findViewById(R.id.checkBoxAmaciante);
		CheckBoxAntimofo = (CheckBox) findViewById(R.id.checkBoxAntimofo);
		chbAntiMofo = (CheckBox) findViewById(R.id.checkBoxAntimofo);
		CheckBoxCeraPasta = (CheckBox) findViewById(R.id.checkBoxCeraPasta);
		chbCeraPasta = (CheckBox) findViewById(R.id.checkBoxCeraPasta);
		CheckBoxCeraLiquida = (CheckBox) findViewById(R.id.checkBoxCeraLiquida);
		chbCeraLiquida = (CheckBox) findViewById(R.id.checkBoxCeraLiquida);
		CheckBoxDesinfetante = (CheckBox) findViewById(R.id.checkBoxDesinfetante);
		chbDesinfetante = (CheckBox) findViewById(R.id.checkBoxDesinfetante);
		CheckBoxDetergente = (CheckBox) findViewById(R.id.checkBoxDetergente);
		chbDetergente = (CheckBox) findViewById(R.id.checkBoxDetergente);
		CheckBoxInseticida = (CheckBox) findViewById(R.id.checkBoxInseticida);
		chbInseticida = (CheckBox) findViewById(R.id.checkBoxInseticida);
		CheckBoxLimpaAluminio = (CheckBox) findViewById(R.id.checkBoxLimpadorAluminio);
		chbLimpaAluminio = (CheckBox) findViewById(R.id.checkBoxLimpadorAluminio);
		CheckBoxLimpaVidro = (CheckBox) findViewById(R.id.checkBoxLimpaVidro);
		chbLimpaVidro = (CheckBox) findViewById(R.id.checkBoxLimpaVidro);
		CheckBoxMultiuso = (CheckBox) findViewById(R.id.checkBoxMultiuso);
		chbMultiuso = (CheckBox) findViewById(R.id.checkBoxMultiuso);
		CheckBoxOdorizador = (CheckBox) findViewById(R.id.checkBoxOdorizador);
		chbOdorizador = (CheckBox) findViewById(R.id.checkBoxOdorizador);
		CheckBoxRemoveodr = (CheckBox) findViewById(R.id.checkBoxRemovedor);
		chbRemovedor = (CheckBox) findViewById(R.id.checkBoxRemovedor);
		CheckBoxRepelente = (CheckBox) findViewById(R.id.checkBoxRepelente);
		chbRepelente = (CheckBox) findViewById(R.id.checkBoxRepelente);
		CheckBoxSabaoPedra = (CheckBox) findViewById(R.id.checkBoxSabaoPedra);
		chbSabaoPedra = (CheckBox) findViewById(R.id.checkBoxSabaoPedra);
		CheckBoxSabaoPo = (CheckBox) findViewById(R.id.checkBoxSabaoPo);
		chbSabaoPo = (CheckBox) findViewById(R.id.checkBoxSabaoPo);
		CheckBoxLadeAco = (CheckBox) findViewById(R.id.checkBoxLaAco);
		chbLadeAco = (CheckBox) findViewById(R.id.checkBoxLaAco);
		CheckBoxSabaoCoco = (CheckBox) findViewById(R.id.checkBoxSabaoCoco);
		chbSabaoCoco = (CheckBox) findViewById(R.id.checkBoxSabaoCoco);
		CheckBoxSapolio = (CheckBox) findViewById(R.id.checkBoxSapolio);
		chbSapolio = (CheckBox) findViewById(R.id.checkBoxSapolio);

		btnPagina5 = (ImageButton) findViewById(R.id.btnPagina5);

		btnPagina5.setOnClickListener(new View.OnClickListener() {

			
			public void onClick(View v) {
				// TODO Auto-generated method stub

				if (chbAguaSanitaria.isChecked()) {
					AguaSanitaria = "Agua Sanit‡ria";
				}
				if (chbAlcool.isChecked()) {
					Alcool = "Alcool";
				}
				if (chbAmaciante.isChecked()) {
					Amaciante = "Amaciante";
				}
				if (chbAntiMofo.isChecked()) {
					Antimofo = "Anti Mofo";
				}
				if (chbCeraPasta.isChecked()) {
					CeraPasta = "Cera Pasta";
				}
				if (chbCeraLiquida.isChecked()) {
					CeraLiquida = "Cera Liquida";
				}
				if (chbDesinfetante.isChecked()) {
					Desinfetante = "Desinfetante";
				}
				if (chbDetergente.isChecked()) {
					Detergente = "Detergente";
				}
				if (chbInseticida.isChecked()) {
					Inseticida = "Inseticida";
				}
				if (chbLimpaAluminio.isChecked()) {
					LimpaAluminio = "Limpa Aluminio";
				}
				if (chbLimpaVidro.isChecked()) {
					LimpaVidro = "Limpa Vidro";
				}
				if (chbMultiuso.isChecked()) {
					Multiuso = "Multi Uso";
				}
				if (chbOdorizador.isChecked()) {
					Odorizador = "Odorizador";
				}
				if (chbRemovedor.isChecked()) {
					Removedor = "Removedor";
				}
				if (chbRepelente.isChecked()) {
					Repelente = "Repelente";
				}
				if (chbSabaoPedra.isChecked()) {
					SabaoPedra = "Sab‹o Pedra";
				}
				if (chbSabaoPo.isChecked()) {
					SabaoPo = "Sab‹o em P—";
				}
				if (chbLadeAco.isChecked()) {
					LadeAco = "L‹ de A�o";
				}
				if (chbSabaoCoco.isChecked()) {
					SabaoCoco = "Sab‹o de Coco";
				}
				if (chbSapolio.isChecked()) {
					Sapolio = "Sapolio";
				}

				LevaAguaSanitaria = AguaSanitaria;
				LevaAlcool = Alcool;
				LevaAmaciante = Amaciante;
				LevaAntimofo = Antimofo;
				LevaCeraLiquida = CeraLiquida;
				LevaCeraPasta = CeraPasta;
				LevaDesinfetante = Desinfetante;
				LevaDetergente = Detergente;
				LevaInseticida = Inseticida;
				LevaLadeAco = LadeAco;
				LevaLimpaAluminio = LimpaAluminio;
				LevaLimpaVidro = LimpaVidro;
				LevaMultiuso = Multiuso;
				LevaOdorizador = Odorizador;
				LevaRemovedor = Removedor;
				LevaRepelente = Repelente;
				LevaSabaoCoco = SabaoCoco;
				LevaSabaoPedra = SabaoPedra;
				LevaSabaoPo = SabaoPo;
				LevaSapolio = Sapolio;

				startActivity(new Intent(Lista_Limpeza.this,
						Lista_Mercearia.class));

			}
		});

	}

	@Override
	protected void onResume() {

		CheckBoxAguaSanitaria.setChecked(mPrefs.getBoolean(PREF_BOOL61, false));
		CheckBoxAlcool.setChecked(mPrefs.getBoolean(PREF_BOOL62, false));
		CheckBoxAmaciante.setChecked(mPrefs.getBoolean(PREF_BOOL63, false));
		CheckBoxAntimofo.setChecked(mPrefs.getBoolean(PREF_BOOL64, false));
		CheckBoxCeraLiquida.setChecked(mPrefs.getBoolean(PREF_BOOL65, false));
		CheckBoxCeraPasta.setChecked(mPrefs.getBoolean(PREF_BOOL66, false));
		CheckBoxDesinfetante.setChecked(mPrefs.getBoolean(PREF_BOOL67, false));
		CheckBoxDetergente.setChecked(mPrefs.getBoolean(PREF_BOOL68, false));
		CheckBoxInseticida.setChecked(mPrefs.getBoolean(PREF_BOOL69, false));
		CheckBoxLadeAco.setChecked(mPrefs.getBoolean(PREF_BOOL70, false));
		CheckBoxLimpaAluminio.setChecked(mPrefs.getBoolean(PREF_BOOL71, false));
		CheckBoxLimpaVidro.setChecked(mPrefs.getBoolean(PREF_BOOL72, false));
		CheckBoxMultiuso.setChecked(mPrefs.getBoolean(PREF_BOOL73, false));
		CheckBoxOdorizador.setChecked(mPrefs.getBoolean(PREF_BOOL74, false));
		CheckBoxRemoveodr.setChecked(mPrefs.getBoolean(PREF_BOOL75, false));
		CheckBoxRepelente.setChecked(mPrefs.getBoolean(PREF_BOOL76, false));
		CheckBoxSabaoCoco.setChecked(mPrefs.getBoolean(PREF_BOOL77, false));
		CheckBoxSabaoPedra.setChecked(mPrefs.getBoolean(PREF_BOOL78, false));
		CheckBoxSabaoPo.setChecked(mPrefs.getBoolean(PREF_BOOL79, false));
		CheckBoxSapolio.setChecked(mPrefs.getBoolean(PREF_BOOL80, false));

		super.onResume();
	}

	@Override
	protected void onPause() {
		Editor e = mPrefs.edit();
		e.putBoolean(PREF_BOOL61, CheckBoxAguaSanitaria.isChecked());
		e.putBoolean(PREF_BOOL62, CheckBoxAlcool.isChecked());
		e.putBoolean(PREF_BOOL63, CheckBoxAmaciante.isChecked());
		e.putBoolean(PREF_BOOL64, CheckBoxAntimofo.isChecked());
		e.putBoolean(PREF_BOOL65, CheckBoxCeraLiquida.isChecked());
		e.putBoolean(PREF_BOOL66, CheckBoxCeraPasta.isChecked());
		e.putBoolean(PREF_BOOL67, CheckBoxDesinfetante.isChecked());
		e.putBoolean(PREF_BOOL68, CheckBoxDetergente.isChecked());
		e.putBoolean(PREF_BOOL69, CheckBoxInseticida.isChecked());
		e.putBoolean(PREF_BOOL70, CheckBoxLadeAco.isChecked());
		e.putBoolean(PREF_BOOL71, CheckBoxLimpaAluminio.isChecked());
		e.putBoolean(PREF_BOOL72, CheckBoxLimpaVidro.isChecked());
		e.putBoolean(PREF_BOOL73, CheckBoxMultiuso.isChecked());
		e.putBoolean(PREF_BOOL74, CheckBoxOdorizador.isChecked());
		e.putBoolean(PREF_BOOL75, CheckBoxRemoveodr.isChecked());
		e.putBoolean(PREF_BOOL76, CheckBoxRepelente.isChecked());
		e.putBoolean(PREF_BOOL77, CheckBoxSabaoCoco.isChecked());
		e.putBoolean(PREF_BOOL78, CheckBoxSabaoPedra.isChecked());
		e.putBoolean(PREF_BOOL79, CheckBoxSabaoPo.isChecked());
		e.putBoolean(PREF_BOOL80, CheckBoxSapolio.isChecked());

		e.commit();
		super.onPause();
	}

}
